<%--
  Created by IntelliJ IDEA.
  User: WeaponLin
  Date: 2015/11/26
  Time: 10:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<html>

<link rel="stylesheet" type="text/css" href="<%=path%>/css/button.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/inputs.css"/>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/app.css"/>
<script type="text/javascript" src="<%=path%>/js/check.js"></script>

<div id="menubar">
    <img src="<%=path%>/images/left.png" style="margin-top:auto;margin-bottom:auto;width:15px; height:15px"><a
        href="<%=path%>/reader/ReaderAction_queryReader.action">读者信息</a>
    <img src="<%=path%>/images/left.png" style="margin-top:auto;margin-bottom:auto;width:15px; height:15px">信息修改
</div>

<s:if test="#session.loginState == 1">
    <form name="readerInfo" action="<%=path%>/reader/ReaderAction_updateReader.action" method="post">
        <table id="inputs" width="35%"
               style="margin: 0 auto; position: absolute;top: 150px; left: 0; bottom: 0; right: 0;overflow:auto;">
            <tr>
                <th style="text-align:center;color:#0088cc">读者编号：</th>
                <td>
                    <input name="readerid" type="text" value="<s:property value="#session.reader.readerid"/>"
                           readonly>
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">姓&nbsp;名：</th>
                <td>
                    <input name="username" type="text" value="<s:property value="#session.reader.readername"/>"
                           readonly>
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">旧密码：</th>
                <td>
                    <input id="oldPassword" name="oldPassword" type="password" placeholder="Old Password"
                           oninput="immediately()" onpropertychange="immediately()"
                           maxlength="12" pattern="(?=^.{6,12}$).*$" title="密码长度至少6位">
                </td>
                <td style="color: red">
                    <s:fielderror fieldName="oldPasswordError"/>
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">新密码：</th>
                <td>
                    <input id="newPassword" name="newPassword" type="password" placeholder="New Password"
                           oninput="immediately()" onpropertychange="immediately()"
                           maxlength="12" pattern="(?=^.{6,12}$).*$" title="密码长度至少6位">
                </td>
                <td style="color: red">
                    <s:fielderror fieldName="verifyPasswordError"/>
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">确认密码：</th>
                <td>
                    <input id="rePassword" name="rePassword" type="password" placeholder="Confirm Password"
                           oninput="immediately()" onpropertychange="immediately()" maxlength="12">
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">性&nbsp;别：</th>
                <td>
                    <input name="gender" type="text" value="<s:property value="#session.reader.sex"/>" readonly>
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">电&nbsp;话：</th>
                <td>
                    <input type="text" name="phone" placeholder="Phone" maxlength="8"
                           pattern="[0-9]{8}" title="例：51681114"
                           value="<s:property value="#session.reader.phone"/>">
                </td>
            </tr>

            <tr>
                <th style="text-align:center;color:#0088cc">手&nbsp;机：</th>
                <td>
                    <input type="text" name="mobile" placeholder="Moblie" maxlength="11"
                           pattern="[0-9]{11}" title="例：18813092670"
                           value="<s:property value="#session.reader.mobile"/>">
                </td>
            </tr>
        </table>
        <table width="10%"
               style="margin: 0 auto; position: absolute;top: 750px; left: 0; bottom: 0; right: 0;overflow:auto;text-align: center">
            <tr>
                <td>
                    <input type="submit" class="button" value="修改">
                </td>
            </tr>
        </table>

    </form>
</s:if>
<s:else>
    <table width="100%" style="margin-top:50px;">
        <tr>
            <td>
                <h2 style="text-align: center">请使用读者账号登录！</h2>
            </td>
        </tr>
    </table>
</s:else>
</html>
